<template>
  <div class="keyboard-number">
    <div class="tab-inside">
      <ReportFinish :devType="devType" :field="field" @handleSignPrint="handleSignPrint" v-if="!layerNameKeySet?.interceptDetailsState"/>
      <ReportAllow v-if="allowReportLen>0" typeInfo="tab" :devType="devType" :field="field" @handleReport="handleReport" @handleReportAll="handleReportAll"/>
    </div>
  </div>
</template>

<script>
import {Tab, Tabs} from 'vant';
import ReportAllow from './report-allow.vue';
import ReportFinish2 from './reportFinish2.vue';
import ReportWarnIcon from './report-warn-icon.vue';
import ReportFailIcon from './report-fail-icon.vue';
import ReportSuccessIcon from './report-success-icon.vue';
import ReportSuccessIcon2 from './report-success-icon2.vue';
import {v4 as uuid} from "uuid";
import ReportFinish
  from "@sc/templateDetails/modules/homeMiddle/scene-widget/module/report/reportComps/report-finish.vue";

export default {
  name: 'reportResult3',

  components: {
    ReportFinish,
    Tab,
    Tabs,
    ReportAllow,
    ReportFinish2,
    ReportWarnIcon,
    ReportFailIcon,
    ReportSuccessIcon,
    ReportSuccessIcon2,
  },

  props: {
    state: {
      type: Number
    },
    devType: {
      type: Boolean,
      default: false,
    },
    field: {
      type: Object,
      default: Object(),
    },
    layerNameKeySet:{
      type: Object,
      default: Object(),
    }
  },

  data() {
    return {
      active: 0,
    }
  },

  computed: {
    // 完成报到列表
    finishReportLen() {
      return function (key) {
        this.widgetKey = uuid();
        let devType = (this.devType);
        let patientInfos = this.$store.getters['getReportPatientInfo'];
        let patientInfo = devType ? (patientInfos.apiData) : (patientInfos.mockData);
        if (patientInfo?.signList?.length) {
          let filterInfo = this.$lodash.filter(patientInfo.signList, {patientDataStatus: String(key)})
          return filterInfo.length;
        } else {
          return 0;
        }
      }
    },

    //允许报到列表
    allowReportLen() {
      let devType = (this.devType);
      let reportPatientInfo = this.$store.getters['getReportPatientInfo'];
      let patientInfos = devType? (reportPatientInfo.apiData) : (reportPatientInfo.mockData)
      return patientInfos?.unSignList.length;
    },

  },

  methods: {
    // 报到
    handleReport(params) {
      this.$emit('handleReport', params);
    },

    // 一键报到
    handleReportAll(params) {
      this.$emit('handleReportAll', params);
    },

    // 打印
    handleSignPrint(params) {
      this.$emit('handleSignPrint', params);
    },

  }
};
</script>

<style lang="scss" scoped>
.keyboard-number {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100%);
  box-sizing: border-box;
  overflow: hidden;

  .tab-inside {
    height: 100%;
    overflow: auto;
    :deep(.report-result-info){
      .swiper-container{
        .swiper-slide-inside{
          .top {
            font-size: 45px;
            line-height: 1.5;
            padding: 24px 0 18px 0;


            .top-item {
              .content {
                .patient_status {
                  padding: 8px 16px;
                  font-size: 40px;
                  border-radius: 12px;
                }
              }
            }

            .patient-orderNo {
              line-height: 1.5;
              font-size: 45px;
            }

            .patient-countNum {
              font-size: 45px;
              line-height:1.5;
            }

            .patient-registerNameKey,
            .patient-roomKey {
              font-size: 45px;
              line-height: 1.5;
            }
          }
          .bottom {
            .item {
              font-size: 35px;
              line-height: 1.5;
              .title {
                font-size: 35px;
              }
            }
          }
        }
      }
    }
  }
}

</style>
